package com.sskj.lib.bean;

import com.sskj.common.base.App;
import com.sskj.lib.R;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 区号
 */
public enum AreaCodeEnum {
    AREA_CODE_86("+86", App.INSTANCE.getString(R.string.lib_areaCodeEnum1)),
    AREA_CODE_82("+82", App.INSTANCE.getString(R.string.lib_areaCodeEnum2)),
    AREA_CODE_81("+81", App.INSTANCE.getString(R.string.lib_areaCodeEnum3)),
    AREA_CODE_60("+60", App.INSTANCE.getString(R.string.lib_areaCodeEnum4)),
    AREA_CODE_886("+886", App.INSTANCE.getString(R.string.lib_areaCodeEnum5));
    private String code;
    private String desc;

    AreaCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public void setCode(String code) {
        this.code = code;
    }


    private static List<AreaCodeEnum> list = new ArrayList<>();

    public static List<AreaCodeEnum> list() {
        if (list.isEmpty()) {
            list.addAll(Arrays.asList(AreaCodeEnum.values()));
        }
        return list;
    }
}
